<?php $this->_extends('_layouts/projects_layout'); ?>

<?php $this->_block('contents'); ?>

<!-- 项目列表 -->
<?php foreach ($projects as $project): ?>

<div class="project-show">

  <div class="right">
    <?php if ($project->is_approbated): ?>
    <a href="<?php echo url('projects/show', array('name' => $project->name)); ?>"><img src="<?php echo $_BASE_DIR; ?>qeephp/btn_download.gif" border="0" /></a>
    <?php endif; ?>
  </div>

  <div class="projects-title">
    <img src="<?php echo $_BASE_DIR; ?>qeephp/icn_project.gif" />

    <h1<?php if (!$project->is_approbated): echo ' class="not-approbated"'; endif; ?>>
      <a href="<?php echo url('projects/show', array('name' => $project->name)); ?>"<?php if ($project->is_picked): ?> class="hot"<?php endif; ?>><?php echo h($project->title); ?></a>
      <?php if (!$project->is_approbated): ?><span class="not-approbated">等待审核</span><?php endif; ?>
      <?php if ($project->is_pending_delete): ?><span class="pending-delete">等待删除</span><?php endif; ?>
    </h1>

    <p>
      <?php if (isset($user['id']) && $user['id'] == $project->member_id): ?>
      作者：<?php echo h($project->owner->username); ?>
      , <a href="<?php echo url('projects/edit', array('name' => $project->name)); ?>" class="oper">修改项目</a>
      <?php else: ?>
      作者：<a href="<?php echo url('projects/index', array('type' => 'member', 'key' => $project->owner->username)); ?>"><?php echo h($project->owner->username); ?></a>
      <?php endif; ?>
    </p>
  </div>

  <div class="projects-contents">
    <ul class="meta clearfix">
      <li>分类：<a href="<?php echo url('projects/index', array('type' => 'cat', 'key' => $project->category->slug)); ?>"><?php echo h($project->category->name); ?></a></li>
      <li>最后更新：<strong><?php echo date('Y-m-d H:i', $project->updated); ?></strong></li>
      <li>下载次数：<strong class="hot"><?php echo $project->downloads_count; ?></strong></li>
    </ul>

    <p><?php echo nl2br(h($project->summary)); ?></p>

    <hr />
  </div>

</div>

<?php endforeach; ?>

<?php $this->_control('pagination', 'projects-pagination', array('pagination' => $pagination, 'url_args' => $pagination_args, 'show_count' => true)); ?>

<!-- /项目列表 -->

<?php $this->_endblock(); ?>

